import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.io.IOException;

public class zidonghuaceshi2 {

        public void zidonghuaceshi2() throws InterruptedException {
            WebDriverManager.chromedriver().setup();
            ChromeOptions options = new ChromeOptions();

            options.addArguments("--remote-allow-origins=*");

            //打开浏览器
            WebDriver driver = new ChromeDriver(options);

            //输入百度网址
            driver.navigate().to("https://www.baidu.com");

            driver.navigate().back();
            Thread.sleep(2000);

            driver.navigate().forward();
            Thread.sleep(2000);

            driver.navigate().refresh();
            Thread.sleep(2000);

            //driver.findElement(By.cssSelector("#chat-textarea")).sendKeys("西南石油大学");
            //driver.findElement(By.cssSelector("#chat-submit-button")).click();

            driver.quit();
        }
}
